package com.banana.springcloud.util;

import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

/**
 * 获取After断言中的时间格式
 * @author layman
 * @date 2021/1/20
 */
public class TimeUtil {
    public static void main(String[] args) {
        ZonedDateTime now = ZonedDateTime.now();
        // 2021-01-20T09:51:48.195+08:00[Asia/Shanghai]
        System.out.println(now);
        System.out.println(LocalDateTime.now());
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = formatter.format(LocalDateTime.now());
        System.out.println(format);

    }
}
